package org.springblade.modules.repair.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
    * 用户扩展表
    */
@Data
@EqualsAndHashCode(callSuper=true)
@TableName(value = "blade_user_cert")
public class UserCert extends TenantEntity {
	/**
	 * 用户id
	 */
	@NotNull(message = "用户姓名不能为空")
	@TableField(value = "user_id")
	@JsonSerialize(using = ToStringSerializer.class)
	private Long userId;

	/**
	 * 证件类型
	 */
	@NotNull(message = "证件类型不能为空")
	@TableField(value = "cert_type")
	private Long certType;

	/**
	 * 作业项目
	 */
	@NotNull(message = "作业项目不能为空")
	@TableField(value = "work_pro")
	private Long workPro;

	/**
	 * 证书编号
	 */
	@NotBlank(message = "证书编号不能为空")
	@TableField(value = "cert_num")
	private String certNum;

	/**
	 * 有效时间起始
	 */
	@NotNull(message = "有效开始日期不能为空")
	@TableField(value = "start_time")
	@JsonFormat(pattern = "yyyy-MM-dd")
	private Date startTime;

	/**
	 * 有效时间结束
	 */
	@NotNull(message = "有效结束日期不能为空")
	@TableField(value = "end_time")
	@JsonFormat(pattern = "yyyy-MM-dd")
	private Date endTime;

	/**
	 * 证件照片地址(多个逗号隔开)
	 */
	@NotBlank(message = "证书照片不能为空")
	@TableField(value = "cert_img")
	private String certImg;
}
